//
//  QrcodeViewController.m
//  Weibo
//
//  Created by wpapple on 16/6/1.
//  Copyright © 2016年 wpapple. All rights reserved.
//

#import "QrcodeViewController.h"

@interface QrcodeViewController ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *scanLineConstraint;

@end

@implementation QrcodeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //定时器
    CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(scan)];
    
    [link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
    
    
}

- (void)scan {
    
    self.scanLineConstraint.constant += 3;
    
    if (self.scanLineConstraint.constant >= 30) {
        self.scanLineConstraint.constant = -170;
    }

    
}
- (IBAction)closeVC:(id)sender {
    
    [self dismissViewControllerAnimated:YES completion:nil];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
